From 37bc9d25deecb04b7970881d46551d5b33fe88df Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 17 Dec 2021 19:21:11 +0100
Subject: chore: add meta to single posts

---
 src/pages/article/[slug].tsx | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

(limited to 'src/pages/article/[slug].tsx')

diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx
index b3ab2ed..57982e9 100644
--- a/src/pages/article/[slug].tsx
+++ b/src/pages/article/[slug].tsx
@@ -1,5 +1,7 @@
 import CommentsList from '@components/CommentsList/CommentsList';
 import Layout from '@components/Layouts/Layout';
+import PostFooter from '@components/PostFooter/PostFooter';
+import PostHeader from '@components/PostHeader/PostHeader';
 import { t } from '@lingui/macro';
 import { fetchAllPostsSlug } from '@services/graphql/blog';
 import { getPostBySlug } from '@services/graphql/post';
@@ -11,16 +13,23 @@ import { ParsedUrlQuery } from 'querystring';
 import { ReactElement } from 'react';
 
 const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => {
+  const { author, comments, content, date, intro, subjects, thematics, title } =
+    post;
+
   return (
     <article>
-      <header>
-        <h1>{post.title}</h1>
-        <div dangerouslySetInnerHTML={{ __html: post.intro }}></div>
-      </header>
-      <div dangerouslySetInnerHTML={{ __html: post.content }}></div>
+      <PostHeader
+        author={author}
+        date={date}
+        intro={intro}
+        title={title}
+        thematics={thematics}
+      />
+      <div dangerouslySetInnerHTML={{ __html: content }}></div>
+      <PostFooter subjects={subjects} />
       <section>
         <h2>{t`Comments`}</h2>
-        <CommentsList comments={post.comments} />
+        <CommentsList comments={comments} />
       </section>
     </article>
   );
-- 
cgit v1.2.3

